package hoodoos.flow;

import hoodoos.rule.api.Facts;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public class FlowRulesEngine {

  private final String name;

  private final FlowRules flowRules;

  private final StatelessFlowRulesEngine statelessRulesEngine;

  public FlowRulesEngine(String name, FlowRules flowRules) {
    super();
    this.name = name;
    this.flowRules = flowRules;
    this.statelessRulesEngine = new StatelessFlowRulesEngine();
  }

  public FlowRulesEngine(String name,
      FlowRules flowRules,
      StatelessFlowRulesEngine statelessRulesEngine) {
    this.name = name;
    this.flowRules = flowRules;
    this.statelessRulesEngine = statelessRulesEngine;
  }

  public Facts fire(Map<String, Object> param) {
    return statelessRulesEngine.fire(name, flowRules, param);
  }

}
